package com.example.pet.service.impl;
import com.example.pet.dao.PetDao;
import com.example.pet.entity.Pet;

import com.example.pet.entity.Shoppingcart;
import com.example.pet.service.PetService;
import io.swagger.annotations.ApiModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
@ApiModel(value="PetServiceImpl",description="宠物")
public class PetServiceImpl implements PetService {
    @Resource
    PetDao petDao;


    @Override
    public boolean add(Pet pet) {
        return petDao.insert(pet)>0;
    }

    @Override
    public List<Pet> queryAll(Integer userId) {
        return petDao.queryAll(userId);
    }

    @Override
    public Pet queryById(Integer petId) {
        return petDao.selectById(petId);
    }
}

